return "Drag to slider 'handle' to enable control of video play time. Requires additional 'extent' member which limits the handle travel range." & RETURN & "PARAMETERS:" & RETURN & "ΓÇó Video Sprite - Enter the number of sprite channel in which video is displayed." & RETURN & "ΓÇó Extent Sprite - Enter the number of sprite channel that contains the 'extent' sprite." & RETURN & "ΓÇó Hilite Member - Member to display while handle is being dragged." & RETURN & "ΓÇó Horizontal - If set, orient extent sprite horizontally, if not set orient vertically." & RETURN & "ΓÇó Dynamic - If set, video time will be updated while handle is dragged, else when handle is released."
end
on compute_val me
set val to 0.0
set val to float(the currentScreenVal of me) / float(the extentlength of me)
set val to val * the valrange of me
set val to val + the min of me
return val
end
on send_the_val me, val
set pMovieTime to val * pDuration
videoseek(sprite(videoSprite), pMovieTime)
end
on beginSprite me
set pDuration to the duration of sprite(videoSprite)
set the min of me to 0.0
set the max of me to 1.0
set the sending of me to 1
set handle to the spriteNum of me
set the tracking of me to 0
set the newLocH of me to the locH of sprite handle
set the newLocV of me to the locV of sprite handle
if the horizontal of me then
set the newLocV of me to the locV of sprite the extentSprite of me
set the minScreen of me to the left of sprite the extentSprite of me
set the maxScreen of me to the right of sprite the extentSprite of me
else
set the newLocH of me to the locH of sprite the extentSprite of me
set the minScreen of me to the left of sprite the extentSprite of me
set the maxScreen of me to the right of sprite the extentSprite of me
end if
set the locH of sprite handle to the newLocH of me
set the locV of sprite handle to the newLocV of me
set the valrange of me to the max of me - the min of me
set the extentlength of me to the maxScreen of me - the minScreen of me
if the sending of me = 0 then
set the dynamic of me to 0
end if
end
on prepareFrame me
if tracking then
set handle to the spriteNum of me
set extent to the extentSprite of me
if the horizontal of me then
set the newLocH of me to the mouseH
set the newLocV of me to the locV of sprite extent
if the newLocH of me < the left of sprite extent then
set the newLocH of me to the left of sprite extent
end if
if the newLocH of me > the right of sprite extent then
set the newLocH of me to the right of sprite extent
end if
set the currentScreenVal of me to the newLocH of me - the minScreen of me
else
set the newLocH of me to the locH of sprite extent
set the newLocV of me to the mouseV
if the newLocV of me < the top of sprite extent then
set the newLocV of me to the top of sprite extent
end if
if the newLocV of me > the bottom of sprite extent then
set the newLocV of me to the bottom of sprite extent
end if
set the currentScreenVal of me to the newLocV of me - the minScreen of me
end if
set the locH of sprite handle to the newLocH of me
set the locV of sprite handle to the newLocV of me
if the dynamic of me then
send_the_val(me, compute_val(me))
end if
else
set x to float(the currentTime of sprite(videoSprite)) / float(pDuration)
set handle to the spriteNum of me
set extent to the extentSprite of me
if the horizontal of me then
set ScreenX to the left of sprite extent + (x * (the right of sprite extent - the left of sprite extent))
set the newLocH of me to ScreenX
set the newLocV of me to the locV of sprite extent
if the newLocH of me < the left of sprite extent then
set the newLocH of me to the left of sprite extent
end if
if the newLocH of me > the right of sprite extent then
set the newLocH of me to the right of sprite extent
end if
set the currentScreenVal of me to the newLocH of me - the minScreen of me
else
set ScreenY to the top of sprite extent + (x * (the bottom of sprite extent - the top of sprite extent))
set the newLocH of me to the locH of sprite extent
set the newLocV of me to ScreenY
if the newLocV of me < the top of sprite extent then
set the newLocV of me to the top of sprite extent
end if
if the newLocV of me > the bottom of sprite extent then
set the newLocV of me to the bottom of sprite extent
end if
set the currentScreenVal of me to the newLocV of me - the minScreen of me
end if
set the locH of sprite handle to the newLocH of me
set the locV of sprite handle to the newLocV of me
end if
end
on mouseDown me
set tracking to 1
set temp to the member of sprite the spriteNum of me
set the member of sprite the spriteNum of me to member the hiliteMember of me
set the hiliteMember of me to temp
end
on mouseUp me
set tracking to 0
set temp to the member of sprite the spriteNum of me
set the member of sprite the spriteNum of me to member the hiliteMember of me
set the hiliteMember of me to temp
if the sending of me then
set x to compute_val(me)
send_the_val(me, x)
end if
end
on mouseUpOutSide me
set tracking to 0
set temp to the member of sprite the spriteNum of me
set the member of sprite the spriteNum of me to member the hiliteMember of me